#include"Comm.hpp"
using namespace std;
int main()
{
    key_t key = getkey();
    printf("server key : 0x%x\n", key);
    int shmid = Create_shm(key);
    printf("server shmid : %d\n",shmid);
    //sleep(6);
    char* start = (char*)attach(shmid);

    //运行
    sleep(3);
    while(1)
    {
        sleep(1);
        printf("client say: %s",start );
    }
    //去链接
    dettach(start);
    //删除共享内存
    Del_shm(shmid);
    return 0;
}